package com.edu.test;

import com.edu.mapper.DepartMapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;

public class MyTest03 {

    private SqlSession sqlSession = null;

    @Before
    public void init() throws IOException {
        String path = "mybatis-config.xml";

        InputStream inputStream = Resources.getResourceAsStream(path);

        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
new
        sqlSession = sqlSessionFactory.openSession();
    }

    @Test
    public void test01(){
        DepartMapper departMapper = sqlSession.getMapper(DepartMapper.class);

    }



}
